<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .c1{
            width: 100px;
            height: 100px;
            border: 1px solid #ccc;
            position: relative;
            top: 100px;
            left: 200px;
        }

        .c2{
            width: 20px;
            height: 20px;
            color: red;
            border: 1px solid red;
            text-align: center;

            position: absolute;
            right: 0px;
            top: 0px;
        }
    </style>
</head>
<body>
    <!-- 外层使用相对定位,内层使用绝对定位 -->
    <div class="c1">
        <div class="c2">×</div>
    </div>
</body>
</html>